//package com.dq.controller.op.opmerchant;
//
//import com.dq.exception.customException.AdminException;
//import com.dq.controller.in.base.BaseAdminQuery;
//import com.dq.controller.op.opmerchant.in.query.MemberQuery;
//import com.dq.vo.Vo;
//import com.dq.vo.baseVo.VO;
//import com.dq.domain.sys.user.user.base.SysUser;
//import com.dq.domain.sys.user.user.WxUser;
//import com.dq.service.AllService;
//import com.github.pagehelper.PageInfo;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.apache.commons.lang3.StringUtils;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RestController;
//
//import java.util.List;
//import java.util.Map;
//
///**
// * @author heshuaijun
// * @date 2019/9/1820:56
// */
//@Api(description = "后台会员管理")
//@RestController
//@RequestMapping("/sys/member")
//public class MemberController extends AllService {
//
//    @ApiOperation("所有会员列表")
//    @PostMapping("/all")
//    @RequiresPermissions("sys:member:all")
//    public Vo all() {
//        //查询列表数据
//        List<SysUser> userlist = sysUserRepository.findAll();
//        return new Vo(VO.toVOCollection(userlist, false));
//    }
//
//    @ApiOperation("根据条件检索会员列表")
//    @PostMapping("/list")
//    @RequiresPermissions("sys:member:list")
//    public Vo list(@RequestBody MemberQuery memberQuery) throws AdminException {
//        memberQuery.format();
//        Map<String, Object> query = memberQuery.parseMap();
//        if (StringUtils.isNotBlank(memberQuery.getNickName())) {
//            query.put("likelocalNickName", BaseAdminQuery.likeSql(memberQuery.getNickName()));
//            query.remove("nickName");
//        }
//        if (StringUtils.isNotBlank(memberQuery.getInviteUserMobile())) {
//            query.put("inviteUser_mobile", memberQuery.getInviteUserMobile());
//            query.remove("inviteUserMobile");
//        }
//        if (StringUtils.isNotBlank(memberQuery.getInviteUserNickName())) {
//            query.put("inviteUser_likelocalNickName", BaseAdminQuery.likeSql(memberQuery.getInviteUserNickName()));
//            query.remove("inviteUserNickName");
//        }
//        query.put("class", "WxUser");
//        List<WxUser> userList = dao.find(dao.queryAdminHql(WxUser.class, query), query);
//        Long count = dao.count(dao.countAdminHql(WxUser.class, query), query);
//        PageInfo pageInfo = new PageInfo((List<WxUser.Vo>) VO.toVOCollection(userList));
//        pageInfo.setTotal(count);
//        return new Vo(pageInfo);
//    }
//}
